package com.zb.jsp.action.active;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.zb.jsp.service.active.AdvertInfoService;
import com.zb.jsp.vo.advert.AdvertVo;

public class AdvertInfoAction extends ActionSupport {
	
	//声明service对象
	AdvertInfoService advertInfoService = new AdvertInfoService();
	//定义接受查询结果的volist对象
	private List<AdvertVo> advertVoLeftList;
	//定义接受查询结果的volist对象
	private List<AdvertVo> advertVoRightList;
	//用于接受活动id的变量
	private Integer activeId;
	
	/**	
	 * 查询广告id和广告名
	 */
	public void findAdvertInfoList(){
		if(activeId == null || activeId == 0){
			//用于注册页面
			advertVoLeftList = advertInfoService.findAdvertInfoList();
			advertVoRightList = new ArrayList<AdvertVo>();
		} else{
			//用于修改页面
			advertVoLeftList = advertInfoService.findAdvertInfoNotAttendAcctiveList(activeId);
			advertVoRightList = advertInfoService.findAdvertInfoAttendAcctiveList(activeId);
		}				
	}
	
	public Integer getActiveId() {
		return activeId;
	}

	public void setActiveId(Integer activeId) {
		this.activeId = activeId;
	}

	public List<AdvertVo> getAdvertVoLeftList() {
		return advertVoLeftList;
	}

	public void setAdvertVoLeftList(List<AdvertVo> advertVoLeftList) {
		this.advertVoLeftList = advertVoLeftList;
	}

	public List<AdvertVo> getAdvertVoRightList() {
		return advertVoRightList;
	}

	public void setAdvertVoRightList(List<AdvertVo> advertVoRightList) {
		this.advertVoRightList = advertVoRightList;
	}
}
